# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python2-tox
_pkgname=tox
pkgver=3.24.4
pkgrel=2
pkgdesc='A generic virtualenv management and test command line tool.'
arch=('any')
url='https://tox.readthedocs.io/'
license=('GPL2')
depends=('python2-py' 'python2-virtualenv' 'python2-packaging' 'python2-pluggy'
         'python2-toml' 'python2-filelock' 'python2-six')
makedepends=('python2-setuptools-scm' 'python2-py' 'python2-virtualenv'
             'python2-pluggy' 'python2-toml' 'python2-filelock'
             'python2-freezegun')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('9fe2256276b83bf3bc55ec1876be41da2ff7217187f4bf8f4d728106f9c63fc59d146de5e424f7a90d28b938d312c175f7c815bfd3a17d329bec9ba4102139fc')

prepare() {
  find "$_pkgname-$pkgver" -name "*.pyc" -delete
}

build() {
  cd "$_pkgname-$pkgver"

  export LC_CTYPE=en_US.UTF-8

  python2 setup.py build
}

package() {
  cd "$_pkgname-$pkgver"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build

  for i in "$pkgdir/usr/bin/"*; do
    mv $i "${i}2"
  done
}

